﻿#include "GUISEASubSysPlateBaseDialog.h"
#include "ui_GUISEASubSysPlateBaseDialog.h"

#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"
#include "FITK_Kernel/FITKCore/FITKActionOperator.h"

#include "FITK_Component/FITKAcousticsModel/FITKAcousticsDiscModel.h"
#include "FITK_Component/FITKAcousticsModel/FITKAcousticsSEAModel.h"
#include "FITK_Component/FITKAcousticsModel/FITKAcousticsDiscNodeList.h"
#include "FITK_Component/FITKAcousticsModel/FITKAbstractSEASubSys.h"
#include "FITK_Component/FITKAcousticsModel/FITKSEASubSysAbsShell.h"
#include "FITK_Component/FITKAcousticsModel/FITKSEASubSysGeoProp.h"
#include "FITK_Component/FITKAcousticsModel/FITKSEASubSysShellCurved.h"

#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsPhysics.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsAbsPhysicsProp.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsSpectraManager.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsAbsNCT.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsSpectraManager.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsAbstractSpectra.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKPhyscisPropertyUniform.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsAbsMaterial.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKPhyscisPropertyGeneralLaminate.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKPhyscisPropertyGeneralLaminateIsoLayer.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKPhyscisPropertyRibbed.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKPhyscisPropertyRibInfo.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKPhyscisPropertyBeam.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsNCTLayUp.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsNCTMultipleNoise.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsNCTUserDefined.h"

#include "PickDataProvider/PickedDataProvider.h"
#include "PickDataProvider/PickedData.h"

#include <QMessageBox>
#include <QStandardItemModel>

namespace GUI {

    GUISEASubSysPlateBaseDialog::GUISEASubSysPlateBaseDialog(Acoustics::FITKAbstractSEASubSysShell* obj, Core::FITKActionOperator* oper, QWidget* parent /*= nullptr*/) :
        GUISEASubSysBaseDialog(obj, oper, parent),
        _ui(new Ui::GUISEASubSysPlateBaseDialog)
    {
        _ui->setupUi(this);
        //创建表格数据
        _tableView_modelNodes = new QStandardItemModel();
        _ui->tableView_BoundaryNodes->setModel(_tableView_modelNodes);
        _tableView_modelGeneralLaminate = new QStandardItemModel();
        _ui->tableView_PropGenLaminate->setModel(_tableView_modelGeneralLaminate);
        //组件输入限定初始化
        _ui->lineEdit_Inside->setValidator(new QRegExpValidator(QRegExp("^-?(\\d+(\\.\\d+)?)$")));
        _ui->lineEdit_Outside->setValidator(new QRegExpValidator(QRegExp("^-?(\\d+(\\.\\d+)?)$")));
        _ui->lineEdit_RadiationAreaMult->setValidator(new QRegExpValidator(QRegExp("^(\\d+(\\.\\d+)?)$")));
        _ui->lineEdit_RadiationPerimeterMult->setValidator(new QRegExpValidator(QRegExp("^(\\d+(\\.\\d+)?)$")));
        _ui->lineEdit_LengthMult->setValidator(new QRegExpValidator(QRegExp("^(\\d+(\\.\\d+)?)$")));
        _ui->lineEdit_WidthMult->setValidator(new QRegExpValidator(QRegExp("^(\\d+(\\.\\d+)?)$")));
    }

    GUISEASubSysPlateBaseDialog::~GUISEASubSysPlateBaseDialog()
    {
        //释放数据
        if (_ui) {
            delete _ui;
            _ui = nullptr;
        }
        if (_tableView_modelNodes) delete _tableView_modelNodes;
        if (_tableView_modelGeneralLaminate) delete _tableView_modelGeneralLaminate;
    }

    void GUISEASubSysPlateBaseDialog::on_pushButton_Cancel_clicked()
    {
        //清除拾取模式和高亮
        GUI::GUIPickInfo::ClearPickInfo();
        this->reject();
    }

    void GUISEASubSysPlateBaseDialog::on_pushButton_OK_clicked()
    {
        if (!_oper)return;
        //获取操作器动作类型
        if (_isCreate)
        {
            //保存执行的脚本
            _pyStr.append("seaSubSys=SEA.SEAShell()");
            Acoustics::FITKAbstractSEASubSysShell* shell= dynamic_cast<Acoustics::FITKSEASubSysDoublyCurvedShell*>(_obj);
            if (!shell)return;
            auto nodes=shell->getNodes();
            for (Acoustics::FITKAbstractSEASubSysWithNodes::SubSysNode node : nodes)
            {
                _pyStr.append(QString("seaSubSys.addPoint(%1)").arg(node._id));
            }
            int type = 0;
            switch (_obj->getSEASubSysType())
            {
            case Acoustics::FITKAbstractSEASubSys::SEASubSysType::SEAFlatPlate:
                type = 1; break;
            case Acoustics::FITKAbstractSEASubSys::SEASubSysType::SEASinglyCurvedShell:
                type = 2; break;
            case Acoustics::FITKAbstractSEASubSys::SEASubSysType::SEADoublyCurvedShell:
                type = 3; break;
            }
            if (type!=3)
                _pyStr.append(QString("seaSubSys.createShell(%1)").arg(type));
            else
            {
                Acoustics::FITKSEASubSysDoublyCurvedShell* doublyCurvedPlate = dynamic_cast<Acoustics::FITKSEASubSysDoublyCurvedShell*>(_obj);
                if (!doublyCurvedPlate)return;
                _pyStr.append(QString("seaSubSys.createShell(%1,%2)").arg(type).arg(doublyCurvedPlate->getNumberOfRing()));
            }
            if (!this->createObjData())
                return;
        }
        else
        {
            _pyStr.append(QString("seaSubSys=SEA.SEAShell.GetSEAShell('%1')").arg(_obj->getDataObjectName()));
            if (!this->editObjData())
                return;
        }
        this->saveScript(_pyStr);
        this->accept();
    }

    void GUISEASubSysPlateBaseDialog::on_comboBox_Construction_currentIndexChanged(int index)
    {
        Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType phyPropType = 
            (Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType)_ui->comboBox_Construction->currentData().toInt();
        //启用物理属性
        if (Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPGeneralLaminatePhysicalProperty == phyPropType)
        {
            _ui->widget_propRibbed->setVisible(false);
            _ui->widget_PropFlatPlate->setVisible(false);
            _ui->tableView_PropGenLaminate->setVisible(true);
            _ui->checkBox_FromPhyProp->setEnabled(true);
        }
        else if (Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPRibbedphysicalProperty == phyPropType)
        {
            _ui->widget_PropFlatPlate->setVisible(false);
            _ui->widget_propRibbed->setVisible(true);
            _ui->tableView_PropGenLaminate->setVisible(false);
            _ui->checkBox_FromPhyProp->setEnabled(false);
        }
        else if (Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPUniformPlat == phyPropType)
        {
            _ui->widget_PropFlatPlate->setVisible(true);
            _ui->widget_propRibbed->setVisible(false);
            _ui->tableView_PropGenLaminate->setVisible(false);
            _ui->checkBox_FromPhyProp->setEnabled(false);
        }
        //初始化设置物理属性选项
        this->initPhysicalPropData(phyPropType);
    }

    void GUISEASubSysPlateBaseDialog::on_comboBox_PhysicalProp_currentIndexChanged(int index)
    {
        //设置质量
        this->initPropOrienData();
    }

    void GUISEASubSysPlateBaseDialog::on_comboBox_Outside_currentTextChanged(const QString & currentString)
    {
        if (currentString == "None" && _ui->comboBox_Inside->currentText() == "None")
            _ui->checkBox_ControlTreatment->setEnabled(false);
        else
            _ui->checkBox_ControlTreatment->setEnabled(true);
        //设置质量
        this->initPropOrienData();
    }

    void GUISEASubSysPlateBaseDialog::on_comboBox_Inside_currentTextChanged(const QString & currentString)
    {
        if (currentString == "None" && _ui->comboBox_Inside->currentText() == "None")
            _ui->checkBox_ControlTreatment->setEnabled(false);
        else
            _ui->checkBox_ControlTreatment->setEnabled(true);
        //设置质量
        this->initPropOrienData();
    }

    void GUISEASubSysPlateBaseDialog::on_checkBox_FromDLF_stateChanged(int state)
    {
        _ui->comboBox_Flexure->setEnabled(state == Qt::Checked);
        _ui->comboBox_Extension->setEnabled(state == Qt::Checked);
        _ui->comboBox_Shear->setEnabled(state == Qt::Checked);
    }

    void GUISEASubSysPlateBaseDialog::on_checkBox_SubDividedPanel_stateChanged(int state)
    {
        //状态改变动作
        _ui->lineEdit_LengthMult->setEnabled(state == Qt::Checked);
        _ui->lineEdit_WidthMult->setEnabled(state == Qt::Checked);
    }

    void GUISEASubSysPlateBaseDialog::on_checkBox_PlexureMDen_stateChanged(int state)
    {
        //状态改变动作
        _ui->comboBox_PlexureMDen->setEnabled(state == Qt::Checked);
    }

    void GUISEASubSysPlateBaseDialog::on_checkBox_ExtensionModalDen_stateChanged(int state)
    {
        //状态改变动作
        _ui->comboBox_ExtensionModal->setEnabled(state == Qt::Checked);
    }

    void GUISEASubSysPlateBaseDialog::on_checkBox_ShearModelDen_stateChanged(int state)
    {
        //状态改变动作
        _ui->comboBox_ShearModel->setEnabled(state == Qt::Checked);
    }

    QString GUISEASubSysPlateBaseDialog::getCreateDataObjName()
    {
        return QString();
    }

    void GUISEASubSysPlateBaseDialog::initShellData()
    {
        //初始化物理属性类型过滤器
        this->initConstructionData();
        //初始化损耗因子下拉列表
        this->initDampingData();
        //初始化声学包下拉列表
        this->initNCTData();
        //初始化模态密度的下拉列表
        this->initModelDensityData();
        //初始化几何数据
        this->initGeometryData();
        //初始化幅值和波
        this->initRadiationWave();

        QString name;
        if (_isCreate)
        {
            name = this->ckeckNameFromMgr(this->getCreateDataObjName());
            //初始化数据名称
            _ui->lineEdit_Name->setText(name);
            //初始化覆盖率，默认100
            _ui->lineEdit_Outside->setText(QString::number(100));
            _ui->lineEdit_Inside->setText(QString::number(100));
            return;
        }

        //获取板数据信息
        Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType phyPropType = Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPUniformPlat;
        int phyPropID = 0, spectraFlexureID = 0, spectraExtensionID = 0, spectraShearID = 0, outsideNCTID = 0, insideNTCID = 0;
        double outsideNCTCovered = 100, insideNCTCovered = 100;
        bool fromUserDLFSpctra = false, fromPhyProp = false, fromNCT = false;
        Acoustics::FITKAbstractSEASubSysShell* shellData = dynamic_cast<Acoustics::FITKAbstractSEASubSysShell*>(_obj);
        if (shellData)
        {
            //获取名称
            name = _obj->getDataObjectName();
            if (name.isEmpty())
                name = this->ckeckNameFromMgr(this->getCreateDataObjName());
            //获取物理属性
            Acoustics::FITKAcousticsAbsPhysicsProp* phyPropData = _obj->getPropSectionObj();
            if (phyPropData)
            {
                phyPropType = phyPropData->getPhysicsPropType();
                phyPropID = phyPropData->getDataObjectID();
            }
            //获取启用参数
            fromUserDLFSpctra = shellData->getFromUserSpectraState();
            fromPhyProp = shellData->getFromPhysicalPropState();
            fromNCT = shellData->getFromNoiseControlState();
            //获取损耗因子参数数据
            spectraFlexureID = shellData->getFlexureSpectraID();
            spectraExtensionID = shellData->getExtensionSpectraID();
            spectraShearID = shellData->getShearSpectraID();
            //获取声学包参数数据
            outsideNCTID = shellData->getOutsideNCTID();
            insideNTCID = shellData->getInsideNCTID();
            outsideNCTCovered = shellData->getOutsideNCTCoveredArea();
            insideNCTCovered = shellData->getInsideNCTCoveredArea();
        }

        //初始化数据名称
        _ui->lineEdit_Name->setText(name);
        //初始化物理属性类型
        int index = _ui->comboBox_Construction->findData((int)phyPropType);
        _ui->comboBox_Construction->setCurrentIndex(index);
        //初始化物理属性
        index = _ui->comboBox_PhysicalProp->findData(phyPropID);
        _ui->comboBox_PhysicalProp->setCurrentIndex(index);
        //初始化启用状态
        _ui->checkBox_FromDLF->setCheckState((fromUserDLFSpctra ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        _ui->checkBox_FromPhyProp->setCheckState((fromPhyProp ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        _ui->checkBox_ControlTreatment->setCheckState((fromNCT ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        //初始化损耗因子
        index = _ui->comboBox_Flexure->findData(spectraFlexureID);
        _ui->comboBox_Flexure->setCurrentIndex(index );
        index = _ui->comboBox_Extension->findData(spectraExtensionID);
        _ui->comboBox_Extension->setCurrentIndex(index );
        index = _ui->comboBox_Shear->findData(spectraShearID);
        _ui->comboBox_Shear->setCurrentIndex(index);
        //初始化声学包
        _ui->lineEdit_Outside->setText(QString::number(outsideNCTCovered));
        _ui->lineEdit_Inside->setText(QString::number(insideNCTCovered));
        index = _ui->comboBox_Outside->findData(outsideNCTID);
        _ui->comboBox_Outside->setCurrentIndex(index);
        index = _ui->comboBox_Inside->findData(insideNTCID);
        _ui->comboBox_Inside->setCurrentIndex(index);

    }

    void GUISEASubSysPlateBaseDialog::initConstructionData()
    {
        //清空数据下拉链表
        _ui->comboBox_Construction->clear();
        //初始化物理属性类型过滤器下拉列表
        _ui->comboBox_Construction->addItem(tr("Uniform"), (int)Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPUniformPlat);
        _ui->comboBox_Construction->addItem(tr("General Laminate"), (int)Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPGeneralLaminatePhysicalProperty);
        _ui->comboBox_Construction->addItem(tr("Ribbed"), (int)Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPRibbedphysicalProperty);
    }

    void GUISEASubSysPlateBaseDialog::initDampingData()
    {
        //清空数据下拉链表
        _ui->comboBox_Flexure->clear();
        _ui->comboBox_Extension->clear();
        _ui->comboBox_Shear->clear();
        //初始化损耗因子下拉列表
        Acoustics::FITKAcousticsPhysics* phyMgr = FITKAPP->getGlobalData()->getPhysicsData<Acoustics::FITKAcousticsPhysics>();
        if (!phyMgr)return;
        //获取频谱管理器
        Acoustics::FITKAcousticsSpectraManager* spectraMgr = phyMgr->getFITKAcousticsSpectraManager();
        if (!spectraMgr)return;
        QList<Acoustics::FITKAcousticsAbstractSpectra*> spectraList = spectraMgr->getSpectraByType(Acoustics::FITKAcousticsAbstractSpectra::AcousticsSpectraType::Damping);
        for (QList<Acoustics::FITKAcousticsAbstractSpectra*>::iterator iter = spectraList.begin(); iter != spectraList.end(); ++iter)
        {
            if (*iter == nullptr)continue;
            _ui->comboBox_Flexure->addItem((*iter)->getDataObjectName(), (*iter)->getDataObjectID());
            _ui->comboBox_Extension->addItem((*iter)->getDataObjectName(), (*iter)->getDataObjectID());
            _ui->comboBox_Shear->addItem((*iter)->getDataObjectName(), (*iter)->getDataObjectID());
        }
    }

    void GUISEASubSysPlateBaseDialog::initPhysicalPropData(int type)
    {
        //获取物理属性类型
        Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType phyPropType = (Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType)type;
        //清空数据下拉链表
        _ui->comboBox_PhysicalProp->clear();
        //初始化物理属性下拉列表
        Acoustics::FITKAcousticsPhysics* phyMgr = FITKAPP->getGlobalData()->getPhysicsData<Acoustics::FITKAcousticsPhysics>();
        if (!phyMgr)return;
        //获取物理属性管理器
        Acoustics::FITKAcousticsPhysicsPropManager* phyPropMgr = phyMgr->getPhysicsPropManager();
        if (!phyPropMgr)return;
        QList<Acoustics::FITKAcousticsAbsPhysicsProp*> propDataList = phyPropMgr->getPhysicsProps(phyPropType);
        for (QList<Acoustics::FITKAcousticsAbsPhysicsProp*>::iterator iter = propDataList.begin(); iter != propDataList.end(); ++iter)
        {
            if (*iter == nullptr)continue;
            _ui->comboBox_PhysicalProp->addItem((*iter)->getDataObjectName(), (*iter)->getDataObjectID());
        }
    }

    void GUISEASubSysPlateBaseDialog::initNCTData()
    {
        //清空数据下拉链表
        _ui->comboBox_Outside->clear();
        _ui->comboBox_Inside->clear();
        //初始化声学包下拉列表
        Acoustics::FITKAcousticsPhysics* phyMgr = FITKAPP->getGlobalData()->getPhysicsData<Acoustics::FITKAcousticsPhysics>();
        if (!phyMgr)return;
        //获取声学包管理器
        Acoustics::FITKAcousticsNCTManager* nctMgr = phyMgr->getFITKAcousticsNCTManager();
        if (!nctMgr)return;
        _ui->comboBox_Outside->addItem("None", -1);
        _ui->comboBox_Inside->addItem("None", -1); 
        int count = nctMgr->getDataCount();
        for (int i = 0; i < count; ++i)
        {
            Acoustics::FITKAcousticsAbsNCT* nctData = nctMgr->getDataByIndex(i);
            if (!nctData)continue;
            _ui->comboBox_Outside->addItem(nctData->getDataObjectName(), nctData->getDataObjectID());
            _ui->comboBox_Inside->addItem(nctData->getDataObjectName(), nctData->getDataObjectID());
        }
    }

    void GUISEASubSysPlateBaseDialog::initModelDensityData()
    {
        //初始化模态密度的下拉列表
        Acoustics::FITKAcousticsPhysics* phyMgr = FITKAPP->getGlobalData()->getPhysicsData<Acoustics::FITKAcousticsPhysics>();
        if (!phyMgr)return;
        //获取频谱管理器
        Acoustics::FITKAcousticsSpectraManager* spectraManager = phyMgr->getFITKAcousticsSpectraManager();
        if (!spectraManager)return;
        QList<Acoustics::FITKAcousticsAbstractSpectra*> spectraList = spectraManager->getSpectraByType(Acoustics::FITKAcousticsAbstractSpectra::AcousticsSpectraType::ModalDensity);
        for (QList<Acoustics::FITKAcousticsAbstractSpectra*>::iterator iter = spectraList.begin(); iter != spectraList.end(); ++iter)
        {
            if (*iter == nullptr)continue;
            _ui->comboBox_PlexureMDen->addItem((*iter)->getDataObjectName(), (*iter)->getDataObjectID());
            _ui->comboBox_ExtensionModal->addItem((*iter)->getDataObjectName(), (*iter)->getDataObjectID());
            _ui->comboBox_ShearModel->addItem((*iter)->getDataObjectName(), (*iter)->getDataObjectID());
        }
    }

    void GUISEASubSysPlateBaseDialog::initPropOrienData()
    {
        if (!_obj)return;
        //获取面积
        Acoustics::FITKSEASubSysGeoProp* geoProp = _obj->getGeoProp();
        if (!geoProp)return;
        //double area = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Area);
        Acoustics::FITKAcousticsPhysics* phyMgr = FITKAPP->getGlobalData()->getPhysicsData<Acoustics::FITKAcousticsPhysics>();
        if (!phyMgr)return;
        //获取物理属性管理器和声学包管理器
        Acoustics::FITKAcousticsPhysicsPropManager* phyPropMgr = phyMgr->getPhysicsPropManager();
        Acoustics::FITKAcousticsNCTManager* nctMgr = phyMgr->getFITKAcousticsNCTManager();
        if (!phyPropMgr || !nctMgr)return;
        //获取质量 Area * Thickness * Density
        double mass = 0, back = 0, front = 0;
        //获取物理属性，声腔数据
        Acoustics::FITKAcousticsAbsPhysicsProp* phyPropData = phyPropMgr->getDataByID(_ui->comboBox_PhysicalProp->currentData().toInt());
        if (!phyPropData)return;
        mass = this->getPhysicsPropMass(phyPropData);
        Acoustics::FITKAcousticsAbsNCT* nctOutsideData = nctMgr->getDataByID(_ui->comboBox_Outside->currentData().toInt());
        if (nctOutsideData)
            front = this->getNCTMass(nctOutsideData);
        Acoustics::FITKAcousticsAbsNCT* nctInsideData = nctMgr->getDataByID(_ui->comboBox_Inside->currentData().toInt());
            back = this->getNCTMass(nctInsideData);
        
        //设置界面质量参数
        double total = mass + back + front;
        _ui->lineEdit_MassBase->setText(QString::number(mass));
        _ui->lineEdit_MassBack->setText(QString::number(back));
        _ui->lineEdit_MassFront->setText(QString::number(front));
        _ui->lineEdit_MassTotal->setText(QString::number(total));

        //获取物理属性类型
        Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType type = phyPropData->getPhysicsPropType();
        if (type == Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPUniformPlat)
        {
            Acoustics::FITKPhyscisPropertyUniform* uniformPhyProp = dynamic_cast<Acoustics::FITKPhyscisPropertyUniform*>(phyPropData);
            if (!uniformPhyProp)return;
            _ui->lineEdit_Material->setText(uniformPhyProp->getMaterialName());
            _ui->lineEdit_Thickness->setText(QString::number(uniformPhyProp->getThickness()));
        }
        else if (type == Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPGeneralLaminatePhysicalProperty)
        {
            Acoustics::FITKPhyscisPropertyGeneralLaminate* generalLaminatePhyProp = dynamic_cast<Acoustics::FITKPhyscisPropertyGeneralLaminate*>(phyPropData);
            if (!generalLaminatePhyProp)return;
            _tableView_modelGeneralLaminate->clear();
            QStringList tableView_headers;
            tableView_headers << tr("Material") << tr("Thickness [m]") << tr("Angle [deg]") << tr("Damping");
            _tableView_modelGeneralLaminate->setHorizontalHeaderLabels(tableView_headers);
            //获取自由阻尼数据
            int count = generalLaminatePhyProp->getDataCount();
            for (int i = 0; i < count; ++i)
            {
                Acoustics::FITKPhyscisPropertyGeneralLaminateIsoLayer* singlyLayerDate = generalLaminatePhyProp->getDataByIndex(i);
                if (!singlyLayerDate)continue;
                _tableView_modelGeneralLaminate->setItem(i, 0, new QStandardItem(singlyLayerDate->getMaterialName()));
                _tableView_modelGeneralLaminate->setItem(i, 1, new QStandardItem(QString::number(singlyLayerDate->getThickness())));
                _tableView_modelGeneralLaminate->setItem(i, 2, new QStandardItem(QString::number(singlyLayerDate->getAngle())));
                Acoustics::FITKAcousticsAbstractSpectra* spectraData = singlyLayerDate->getDLFSplectrumObj();
                if (spectraData)
                    _tableView_modelGeneralLaminate->setItem(i, 3, new QStandardItem(spectraData->getDataObjectName()));
            }
            // 表格宽度自动根据UI进行计算，不可手动调整宽度
            _ui->tableView_PropGenLaminate->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
            _ui->tableView_PropGenLaminate->setEditTriggers(QAbstractItemView::NoEditTriggers);
        }
        else if (type == Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPRibbedphysicalProperty)
        {
            Acoustics::FITKPhyscisPropertyRibbed* ribbedPhyProp = dynamic_cast<Acoustics::FITKPhyscisPropertyRibbed*>(phyPropData);
            if (!ribbedPhyProp)return;
            //获取基板属性，筋
            Acoustics::FITKAcousticsAbsPhysicsProp* skinData = ribbedPhyProp->getSkinPropObj();
            Acoustics::FITKPhyscisPropertyRibInfo* rib1Data = ribbedPhyProp->getDri1RibInfo();
            Acoustics::FITKPhyscisPropertyRibInfo* rib2Data = ribbedPhyProp->getDri2RibInfo();
            if (!skinData || !rib1Data || !rib1Data->getBeamPropObj())return;
            _ui->lineEdit_Skin->setText(skinData->getDataObjectName());
            _ui->lineEdit_Ribs_Set_1->setText(rib1Data->getBeamPropObj()->getDataObjectName());
            _ui->lineEdit_S1->setText(QString::number(rib1Data->getSpacing()));
            _ui->lineEdit_h1->setText(QString::number(rib1Data->getOffset()));
            if (rib2Data->getBeamPropObj())
            {
                _ui->lineEdit_Ribs_Set_2->setText(rib1Data->getBeamPropObj()->getDataObjectName());
            }
            else
            {
                _ui->lineEdit_Ribs_Set_2->setText("None");
            }
            _ui->lineEdit_S2->setText(QString::number(rib2Data->getSpacing()));
            _ui->lineEdit_h2->setText(QString::number(rib2Data->getOffset()));
        }
    }

    void GUISEASubSysPlateBaseDialog::initGeometryData()
    {
        if (!_obj)return;
        //获取板的几何属性
        Acoustics::FITKSEASubSysGeoProp* geoProp = _obj->getGeoProp();
        if (!geoProp)return;
        //获取几何属性数据
        double perimeter = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Circumference);
        double area = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Area);
        double rR1 = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::RadiusR1);
        double rR2 = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::RadiusR2);
        double angle = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Angle);
        //设置界面数据
        _ui->lineEdit_Perimeter->setText(QString::number(perimeter));
        _ui->lineEdit_Area->setText(QString::number(area));
        _ui->lineEdit_Radius_R1->setText(QString::number(rR1));
        _ui->lineEdit_Radius_R2->setText(QString::number(rR2));
        _ui->lineEdit_Angle->setText(QString::number(angle));
        //获取离散数据
        Acoustics::FITKAcousticsDiscModel* discModel = FITKAPP->getGlobalData()->getMeshData<Acoustics::FITKAcousticsDiscModel>();
        if (!discModel)return;
        //获取SEA点数据
        Acoustics::FITKAcousticsSEAModel* seaModel = discModel->getSEAModel();
        if (!seaModel)return;
        //获取节点管理器
        Acoustics::FITKAcousticsDiscNodeList* seaNodesList = discModel->getNodes();
        if (!seaNodesList)return;

        _tableView_modelNodes->clear();
        QStringList tableView_headers;
        tableView_headers << tr("ID") << tr("X") << tr("Y") << tr("Z");
        _tableView_modelNodes->setHorizontalHeaderLabels(tableView_headers);
        //获取节点数据
        QList<int> nodesIDList = _obj->getNodeIDs();
        for (int i = 0; i < nodesIDList.size(); ++i)
        {
            int id = nodesIDList.at(i);
            Core::FITKNode* nodeData = seaNodesList->getNodeByID(id);
            if (!nodeData)continue;
            _tableView_modelNodes->setItem(i, 0, new QStandardItem(QString::number(id)));
            _tableView_modelNodes->setItem(i, 1, new QStandardItem(QString::number(nodeData->x())));
            _tableView_modelNodes->setItem(i, 2, new QStandardItem(QString::number(nodeData->y())));
            _tableView_modelNodes->setItem(i, 3, new QStandardItem(QString::number(nodeData->z())));
        }
        // 表格宽度自动根据UI进行计算，不可手动调整宽度
        _ui->tableView_BoundaryNodes->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
        _ui->tableView_BoundaryNodes->setEditTriggers(QAbstractItemView::NoEditTriggers);
    }

    void GUISEASubSysPlateBaseDialog::initRadiationWave()
    {
        Acoustics::FITKAbstractSEASubSysShell* shellData = dynamic_cast<Acoustics::FITKAbstractSEASubSysShell*>(_obj);
        if (!shellData)return;
        //获取板的几何属性
        Acoustics::FITKSEASubSysGeoProp* geoProp = shellData->getGeoProp();
        if (!geoProp)return;
        //获取几何属性数据
        double perimeter = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Circumference);
        double area = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Area);
        double length = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Length);
        double widet = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Width);
        //获取有效辐射维度数据
        double effRadiationAreaMagnification = shellData->getEffRadiationAreaMagnification();
        double effRadiationPerimeterMagnification = shellData->getEffRadiationPerimeterMagnification();
        //获取弯曲波的数据
        bool isEnableFlexure = shellData->getFlexureInSEAMatrixSolution();
        bool flexureCorrectionSDP = shellData->getFlexureCorrectionSDP();
        double flexureSDPLengthMagnification = shellData->getFlexureSDPLengthMagnification();
        double flexureSDPWidthMagnification = shellData->getFlexureSDPWidthMagnification();
        bool flexureModelDensityState = shellData->getFlexureModelDensityState();
        int flexureModelDensityID = shellData->getFlexureModelDensityID();
        //获取拉伸波的数据
        bool isEnableExtension = shellData->getExtensionInSEAMatrixSolution();
        bool extensionModelDensityState = shellData->getExtensionModelDensityState();
        int extensionModelDensityID = shellData->getExtensionModelDensityID();
        //获取剪切波的数据
        bool isEnableShear = shellData->getShearInSEAMatrixSolution();
        bool shearModelDensityState = shellData->getShearModelDensityState();
        int shearModelDensityID = shellData->getShearModelDensityID();
        //设置有效辐射维度界面数据
        _ui->lineEdit_RadiationArea->setText(QString::number(area));
        _ui->lineEdit_RadiationPerimeter->setText(QString::number(perimeter));
        _ui->lineEdit_RadiationAreaMult->setText(QString::number(effRadiationAreaMagnification));
        _ui->lineEdit_RadiationPerimeterMult->setText(QString::number(effRadiationPerimeterMagnification));
        //设置弯曲波界面数据
        _ui->checkBox_EnableFlexure->setCheckState((isEnableFlexure ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        _ui->checkBox_SubDividedPanel->setCheckState((flexureCorrectionSDP ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        _ui->lineEdit_Length->setText(QString::number(length));
        _ui->lineEdit_Width->setText(QString::number(widet));
        _ui->lineEdit_LengthMult->setText(QString::number(flexureSDPLengthMagnification));
        _ui->lineEdit_WidthMult->setText(QString::number(flexureSDPWidthMagnification));
        _ui->checkBox_PlexureMDen->setCheckState((flexureModelDensityState ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        int index = _ui->comboBox_PlexureMDen->findData(flexureModelDensityID);
        _ui->comboBox_PlexureMDen->setCurrentIndex(index);
        //设置弯曲波界面数据
        _ui->checkBox_EnableExtension->setCheckState((isEnableExtension ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        _ui->checkBox_ExtensionModalDen->setCheckState((extensionModelDensityState ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        index = _ui->comboBox_ExtensionModal->findData(extensionModelDensityID);
        _ui->comboBox_ExtensionModal->setCurrentIndex(index);
        //设置剪切波界面数据
        _ui->checkBox_EnableShear->setCheckState((isEnableShear ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        _ui->checkBox_ShearModelDen->setCheckState((shearModelDensityState ? Qt::CheckState::Checked : Qt::CheckState::Unchecked));
        index = _ui->comboBox_ShearModel->findData(shearModelDensityID);
        _ui->comboBox_ShearModel->setCurrentIndex(index);
    }

    void GUISEASubSysPlateBaseDialog::initComponent()
    {
        //初始化组件
    }

    void GUISEASubSysPlateBaseDialog::getDataFormWidget()
    {
        Acoustics::FITKAbstractSEASubSysShell* shellData = dynamic_cast<Acoustics::FITKAbstractSEASubSysShell*>(_obj);
        if (!shellData)return;
        //从窗口获取物理属性数据
        int propDataID = _ui->comboBox_PhysicalProp->currentData().toInt();
        //获取启用状态
        bool fromUserDLFSpctra = _ui->checkBox_FromDLF->checkState() == Qt::CheckState::Checked;
        bool fromPhyProp = _ui->checkBox_FromPhyProp->checkState() == Qt::CheckState::Checked;
        bool fromNCT = _ui->checkBox_ControlTreatment->checkState() == Qt::CheckState::Checked;
        //从窗口获取损耗因子的数据
        int flexureSpectraID = _ui->comboBox_Flexure->currentData().toInt();
        int extensionSpectraID = _ui->comboBox_Extension->currentData().toInt();
        int shearSpectraID = _ui->comboBox_Shear->currentData().toInt();
        //从窗口获取声学包的数据
        double outsideNCTCovered = _ui->lineEdit_Outside->text().toDouble();
        double insideNCTCovered = _ui->lineEdit_Inside->text().toDouble();
        int outsideNCTID = _ui->comboBox_Outside->currentData().toInt();
        int insideNTCID = _ui->comboBox_Inside->currentData().toInt();
        //从窗口获取有效辐射维度数据
        double effRadiationAreaMagnification = _ui->lineEdit_RadiationAreaMult->text().toDouble();
        double effRadiationPerimeterMagnification = _ui->lineEdit_RadiationPerimeterMult->text().toDouble();
        //从窗口获取弯曲波的数据
        bool isEnableFlexure = _ui->checkBox_EnableFlexure->checkState() == Qt::CheckState::Checked;
        bool flexureCorrectionSDP = _ui->checkBox_SubDividedPanel->checkState() == Qt::CheckState::Checked;
        double flexureSDPLengthMagnification = _ui->lineEdit_LengthMult->text().toDouble();
        double flexureSDPWidthMagnification = _ui->lineEdit_WidthMult->text().toDouble();
        bool flexureModelDensityState = _ui->checkBox_PlexureMDen->checkState() == Qt::CheckState::Checked;
        int flexureModelDensityID = _ui->comboBox_PlexureMDen->currentData().toInt();
        //从窗口获取拉伸波的数据
        bool isEnableExtension = _ui->checkBox_EnableExtension->checkState() == Qt::CheckState::Checked;
        bool extensionModelDensityState = _ui->checkBox_ExtensionModalDen->checkState() == Qt::CheckState::Checked;
        int extensionModelDensityID = _ui->comboBox_ExtensionModal->currentData().toInt();
        //从窗口获取剪切波的数据
        bool isEnableShear = _ui->checkBox_EnableShear->checkState() == Qt::CheckState::Checked;
        bool shearModelDensityState = _ui->checkBox_ShearModelDen->checkState() == Qt::CheckState::Checked;
        int shearModelDensityID = _ui->comboBox_ShearModel->currentData().toInt();
        //设置物理属性数据
        _obj->setPropSection(propDataID);
        //设置启用状态
        shellData->setFromUserSpectraState(fromUserDLFSpctra);
        shellData->setFromPhysicalPropState(fromPhyProp);
        shellData->setFromNoiseControlState(fromNCT);
        //设置损耗因子数据
        shellData->setFlexureSpectraID(flexureSpectraID);
        shellData->setExtensionSpectraID(extensionSpectraID);
        shellData->setShearSpectraID(shearSpectraID);
        //设置声学包数据
        shellData->setOutsideNCTID(outsideNCTID);
        shellData->setInsideNCTID(insideNTCID);
        shellData->setOutsideNCTCoveredArea(outsideNCTCovered);
        shellData->setInsideNCTCoveredArea(insideNCTCovered);
        //设置有效辐射维度数据
        shellData->setEffRadiationAreaMagnification(effRadiationAreaMagnification);
        shellData->setEffRadiationPerimeterMagnification(effRadiationPerimeterMagnification);
        //设置弯曲波的数据
        shellData->setFlexureInSEAMatrixSolution(isEnableFlexure);
        shellData->setFlexureCorrectionSDP(flexureCorrectionSDP);
        shellData->setFlexureSDPLengthMagnification(flexureSDPLengthMagnification);
        shellData->setFlexureSDPWidthMagnification(flexureSDPWidthMagnification);
        shellData->setFlexureModelDensityState(flexureModelDensityState);
        shellData->setFlexureModelDensityID(flexureModelDensityID);
        //设置拉伸波的数据
        shellData->setExtensionInSEAMatrixSolution(isEnableExtension);
        shellData->setExtensionModelDensityState(extensionModelDensityState);
        shellData->setExtensionModelDensityID(extensionModelDensityID);
        //设置剪切波的数据
        shellData->setShearInSEAMatrixSolution(isEnableShear);
        shellData->setShearModelDensityState(shearModelDensityState);
        shellData->setShearModelDensityID(shearModelDensityID);

        if (fromUserDLFSpctra) 
        {
            _pyStr.append(QString("seaSubSys.setDamping(1,'%1')").arg(_ui->comboBox_Flexure->currentText()));
            _pyStr.append(QString("seaSubSys.setDamping(2,'%1')").arg(_ui->comboBox_Extension->currentText()));
            _pyStr.append(QString("seaSubSys.setDamping(3,'%1')").arg(_ui->comboBox_Shear->currentText()));
        }
        else 
            _pyStr.append(QString("seaSubSys.closeDamping()"));
        _pyStr.append(QString("seaSubSys.setNCT(1,%1,'%2')").arg(insideNCTCovered).arg(_ui->comboBox_Inside->currentText()));
        _pyStr.append(QString("seaSubSys.setNCT(2,%1,'%2')").arg(outsideNCTCovered).arg(_ui->comboBox_Outside->currentText()));
        _pyStr.append(QString("seaSubSys.setPhysicalProp('%1')").arg(_ui->comboBox_PhysicalProp->currentText()));
        _pyStr.append(QString("seaSubSys.setDampingFromNCT(%1)").arg(fromNCT));
        _pyStr.append(QString("seaSubSys.setDampingFromPhyProp(%1)").arg(fromPhyProp));
        _pyStr.append(QString("seaSubSys.setEffRadiationDimensions(%1,%2)").arg(effRadiationAreaMagnification).arg(effRadiationPerimeterMagnification));
        _pyStr.append(QString("seaSubSys.setSEAMatrixSolution_ModalDensity(1,%1,%2,'%3')").arg(isEnableFlexure).arg(flexureModelDensityState).arg(_ui->comboBox_PlexureMDen->currentText()));
        _pyStr.append(QString("seaSubSys.setSEAMatrixSolution_ModalDensity(2,%1,%2,'%3')").arg(isEnableExtension).arg(extensionModelDensityState).arg(_ui->comboBox_ExtensionModal->currentText()));
        _pyStr.append(QString("seaSubSys.setSEAMatrixSolution_ModalDensity(3,%1,%2,'%3')").arg(isEnableShear).arg(shearModelDensityState).arg(_ui->comboBox_ShearModel->currentText()));
        _pyStr.append(QString("seaSubSys.setFlexureCorrectionSDP(%1,%2,%3)").arg(flexureCorrectionSDP).arg(flexureSDPLengthMagnification).arg(flexureSDPWidthMagnification));
    }

    QString GUISEASubSysPlateBaseDialog::getNameFormWidget()
    {
        return _ui->lineEdit_Name->text();
    }

    double GUISEASubSysPlateBaseDialog::getPhysicsPropMass(Acoustics::FITKAcousticsAbsPhysicsProp* phyPropData)
    {
        if (!phyPropData || !_obj)
            return 0.0;
        //获取板的几何属性
        Acoustics::FITKSEASubSysGeoProp* geoProp = _obj->getGeoProp();
        if (!geoProp)return 0.0;
        //获取面积
        double area = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Area);
        //获取物理属性类型
        Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType type = phyPropData->getPhysicsPropType();
        if (type == Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPUniformPlat)
        {
            //获取均质板的质量
            Acoustics::FITKPhyscisPropertyUniform* uniformPhyProp = dynamic_cast<Acoustics::FITKPhyscisPropertyUniform*>(phyPropData);
            if (!uniformPhyProp)return 0.0;
            Acoustics::FITKAcousticsAbsMaterial* materialData = uniformPhyProp->getMaterial();
            if (!materialData)return 0.0;
            //均质板的质量 1 * thickness * density * area
            return uniformPhyProp->getThickness() * materialData->getDensity() * area;
        }
        else if (type == Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPRibbedphysicalProperty)
        {
            //获取加筋板的单位质量
            Acoustics::FITKPhyscisPropertyRibbed* ribbedPhyProp = dynamic_cast<Acoustics::FITKPhyscisPropertyRibbed*>(phyPropData);
            if (!ribbedPhyProp)return 0.0;
            //获取基板属性
            Acoustics::FITKAcousticsAbsPhysicsProp* skinData = ribbedPhyProp->getSkinPropObj();
            if (!skinData)return 0.0;
            //获取第一个筋
            Acoustics::FITKPhyscisPropertyRibInfo* rib1Data = ribbedPhyProp->getDri1RibInfo();
            if (!rib1Data)return 0.0;
            Acoustics::FITKPhyscisPropertyBeam* rib1BeamData = dynamic_cast<Acoustics::FITKPhyscisPropertyBeam*>(rib1Data->getBeamPropObj());
            if (!rib1BeamData) return 0.0;
            Acoustics::FITKAcousticsAbsMaterial* rib1MaterialData = rib1BeamData->getMaterial();
            if (!rib1MaterialData)return 0.0;
            //基板的质量
            double skinMass = this->getPhysicsPropMass(skinData);
            //筋质量 梁截面*密度*面积/加筋间距
            double rib1Mass = rib1BeamData->getCrossSectionArea() * rib1MaterialData->getDensity() * area / rib1Data->getSpacing();
            //获取第二个筋
            Acoustics::FITKPhyscisPropertyRibInfo* rib2Data = ribbedPhyProp->getDri2RibInfo();
            if (!rib2Data) return skinMass + rib1Mass;
            Acoustics::FITKPhyscisPropertyBeam* rib2BeamData = dynamic_cast<Acoustics::FITKPhyscisPropertyBeam*>(rib2Data->getBeamPropObj());
            if (!rib2BeamData) return skinMass + rib1Mass;
            Acoustics::FITKAcousticsAbsMaterial* rib2MaterialData = rib2BeamData->getMaterial();
            if (!rib2MaterialData)return 0.0;
            double rib2Mass = rib2BeamData->getCrossSectionArea() * rib2MaterialData->getDensity() * area / rib2Data->getSpacing();
            return skinMass + rib1Mass + rib2Mass;
        }
        else if (type == Acoustics::FITKAcousticsAbsPhysicsProp::AcousticsPhyscisPropType::APPGeneralLaminatePhysicalProperty)
        {
            //获取自由阻尼层合板的单位质量
            Acoustics::FITKPhyscisPropertyGeneralLaminate* generalLaminatePhyProp = dynamic_cast<Acoustics::FITKPhyscisPropertyGeneralLaminate*>(phyPropData);
            if (!generalLaminatePhyProp)return 0.0;
            //自由阻尼层合板的单位质量 1 * (thickness1 * density1 + thickness2 * density2 + ...)
            double unitMass = 0.0;
            int count = generalLaminatePhyProp->getDataCount();
            for (int i = 0; i < count; ++i)
            {
                Acoustics::FITKPhyscisPropertyGeneralLaminateIsoLayer* singlyLayerDate = generalLaminatePhyProp->getDataByIndex(i);
                if (!singlyLayerDate)continue;
                Acoustics::FITKAcousticsAbsMaterial* materialData = singlyLayerDate->getMaterialObj();
                if (!materialData)return 0.0;
                unitMass += singlyLayerDate->getThickness() * materialData->getDensity();
            }
            //自由阻尼层合板的质量 
            return unitMass * area;
        }
        return 0.0;
    }

    double GUISEASubSysPlateBaseDialog::getNCTMass(Acoustics::FITKAcousticsAbsNCT* nctData)
    {
        if (!nctData) return 0.0;
        //获取板的几何属性
        Acoustics::FITKSEASubSysGeoProp* geoProp = _obj->getGeoProp();
        if (!geoProp)return 0.0;
        //获取面积
        double area = geoProp->getGeoProp(Acoustics::FITKSEASubSysGeoProp::GeoPropType::Area);
        Acoustics::FITKAcousticsAbsNCT::NCTType type = nctData->getNCTType();
        if (type == Acoustics::FITKAcousticsAbsNCT::NCTType::TreatmentLayUp)
        {
            Acoustics::FITKAcousticsNCTLayUp* treatmentLayUp = dynamic_cast<Acoustics::FITKAcousticsNCTLayUp*>(nctData);
            if (!treatmentLayUp)return 0.0;
            return treatmentLayUp->getMassPerUnitArea() * area;
        }
        else if (type == Acoustics::FITKAcousticsAbsNCT::NCTType::UserDefTreatment)
        {
            Acoustics::FITKAcousticsNCTUserDefined* userDefTreatment = dynamic_cast<Acoustics::FITKAcousticsNCTUserDefined*>(nctData);
            if (!userDefTreatment)return 0.0;
            return userDefTreatment->getMassPerUnitArea() * area;
        }
        else if (type == Acoustics::FITKAcousticsAbsNCT::NCTType::MulitipleNCT)
        {
            Acoustics::FITKAcousticsNCTMultipleNoise* mulitipleNCT = dynamic_cast<Acoustics::FITKAcousticsNCTMultipleNoise*>(nctData);
            if (!mulitipleNCT)return 0.0;
            double mass = 0.0;
            int count = mulitipleNCT->getDataCount();
            for (int i = 0; i < count; ++i)
            {
                Acoustics::FITKAcousticsNCTMultipleNoiseWeight* mulitipleNCTWeight = mulitipleNCT->getDataByIndex(i);
                if (!mulitipleNCTWeight)continue;
                int id = mulitipleNCTWeight->getNCTID();
                Acoustics::FITKAcousticsAbsNCT* data = FITKDATAREPO->getTDataByID<Acoustics::FITKAcousticsAbsNCT>(id);
                if (!data)continue;
                mass += this->getNCTMass(data);
            }
            return mass;
        }
        return 0.0;
    }
}
